package chatroom;

import org.directwebremoting.ScriptSession;
import org.directwebremoting.ScriptSessionFilter;

public class MyScriptSessionFilter implements ScriptSessionFilter{
	
	private String attributeName; 
	private String attributeValue; 
	
	public MyScriptSessionFilter(String attributeName, String attributeValue){
		this.attributeName = attributeName;
		this.attributeValue = attributeValue;
	}
	
	@Override
	public boolean match(ScriptSession session) {
		Object value = session.getAttribute(attributeName);
        return value.toString().equals(attributeValue);
	}
	
}
